#ifndef FINDTEXTDIALOG_H
#define FINDTEXTDIALOG_H

#include <QDialog>
#include <QMouseEvent>
namespace Ui {
class FindTextDialog;
}

class FindTextDialog : public QDialog
{
    Q_OBJECT

public:
    explicit FindTextDialog(QWidget *parent = nullptr);
    ~FindTextDialog();
    //enum Direction{Up,Down};
private slots:
    void on_closeBtn_clicked();

    void on_cancelBtn_clicked();

    void setNextBtnEnable();

    void on_findNextBtn_clicked();
signals:
    void searchText(const QString& text,bool isCaseSensitive,bool isLoop,bool direction);
protected:
    void mousePressEvent(QMouseEvent *e) override;
    void mouseMoveEvent(QMouseEvent *e) override;

private:
    Ui::FindTextDialog *ui;
    bool isCaseSensitive;//是否区分大小写,默认不区分
    bool isLoop;//是否循环,默认不循环
    bool direction;//方向：上是true，下是false,默认向上
    QPoint m_dragPos;//用于记录鼠标按下相对应左上角的位置
};

#endif // FINDTEXTDIALOG_H
